package com.xh.bussiness.practice.dao;

import com.xh.bussiness.practice.bean.dto.PracticeStudentVO;
import com.xh.bussiness.practice.model.PracticeStudentResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.catalina.LifecycleState;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 学生作业作答结果 Mapper 接口
 * </p>
 *
 * @author Pitt
 * @since 2021-01-26
 */
public interface PracticeStudentResultMapper extends BaseMapper<PracticeStudentResult> {

    void deleteByPracticeId(@Param("practiceId") String practiceId);

    void deleteByPracticeIdAndStuId(@Param("practiceId") String practiceId,@Param("studentId") String studentId);

    List<PracticeStudentResult> queryStudentScore(@Param("practiceId") String practiceId);

    PracticeStudentVO queryQuestionAnalysis(@Param("practiceId") String practiceId, @Param("questionId") String questionId);

    PracticeStudentVO queryPracticeAnalysis(@Param("practiceId") String practiceId);

    Integer queryBelowAvg(@Param("practiceId") String practiceId, @Param("questionId") String questionId,@Param("score")double score);

    Integer queryPracticeBelowAvg(@Param("practiceId") String practiceId,@Param("score")double score);

    /**
     * 根据班级id查询学生错题，根据学生和试题去重
     * @author 赵文博
     * @date 2021/4/27 10:47
     * @param classId
     * @return java.util.List<java.lang.String>
     **/
    List<String> queryErrorQuestionByClassId(@Param("classId") String classId,
                                             @Param("nowStr") String nowStr,
                                             @Param("minusMonthStr") String minusMonthStr,
                                             @Param("basicType") String basicType);
}
